<?php
/** @noinspection PhpUnused */
declare(strict_types=1);

namespace app\shop\controller;

use app\shop\exception\ParamsErrorException;
use app\shop\logic\UserCouponLogic;
use app\shop\validate\UserCouponValidate;
use think\response\Json;

/**
 * @property UserCouponLogic $logic
 */
class UserCouponController extends BaseController
{
    protected string $validateClassName = UserCouponValidate::class;

    public function __construct()
    {
        parent::__construct();

        $this->logic = new UserCouponLogic();
    }

    /**
     * 列表
     * @return Json
     * @throws ParamsErrorException
     */
    public function list(): Json
    {
        $params = $this->getInput(true);

        $this->validateData($params, 'list');

        $result = $this->logic->list($params);

        return $this->success($result);
    }
}